/*  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#ifndef luge_node_hh
#define luge_node_hh

#include <gegl.h>
#include <lualib.h>
#include <lauxlib.h>
#include <lua.h>

namespace luge {

/**
 * constructor function for a node. This is a lua-function.
 */
int node_construct (lua_State *ls);

/**
 * convert the object to a gegl-node.
 * No actual conversion is done; the object already has to
 * be a userdata representing a gegl-node.
 */
GeglNode *to_node (lua_State *ls, int idx);

/**
 * test if the object is a gegl-node.
 */
bool is_node (lua_State *ls, int idx);

/**
 * push a node onto the stack. After it is pushed,
 * the reference count is increased by calling g_object_ref for node.
 */
void push_node (lua_State *ls, GeglNode *node);

} /* namespace luge */

#endif
